<?php
session_start();
require_once 'HTML5Header.php';
?>

<body>

    <?php require_once 'BarraNavegacion.php'?>

    <div class="container">

      <!-- Main hero unit for a primary marketing message or call to action -->
      
		<div class="hero-unit">
			<h1>Contacto MoodvieWeb</h1>
			</br>
			<p>Envienos sus sugerencias y/o problemas e intentaremos solucionarlos y/o responder lo antes posible.</p>
			</br>
				<form action="mailing.php" method='post' id="contact-form" class="form-vertical">
				  <legend>Contacto</br><small>(La informacion sera tratada de forma confidencial)</small></legend>
					<div class="control-group">
					  <label class="control-label" for="name">Nombre</label>
					  <div class="controls">
						<input type="text" class="input-large" name="name" id="name">
					  </div>
					</div>
					<div class="control-group">
					  <label class="control-label" for="email">Email <small>(Opcional: Si desea recibir respuesta)</small></label>
					  <div class="controls">
						<input type="text" class="input-large" name="email" id="email">
					  </div>
					</div>
					<div class="control-group">
					  <label class="control-label" for="subject">Asunto</label>
					  <div class="controls">
						<input type="text" class="input-large" name="subject" id="subject">
					  </div>
					</div>
					<div class="control-group">
					  <label class="control-label" for="message">Mensaje</label>
					  <div class="controls">
						<textarea class="input-xlarge" name="message" id="message" rows="3"></textarea>
					  </div>
					</div>
					<div class="form-actions">
					  <button type="submit" value="Send Email" class="btn btn-primary btn-large">Enviar</button>
					  <button type="reset" class="btn">Cancelar</button>
					</div>
				</form>
		</div>
      <hr>
<?php 
	/*$name = $_POST['name'];  
	$email = $_POST['email']; 
	$asunto = $_POST['subject'];
	$todayis = date("l, F j, Y, g:i a e"); 
	$success = " 
	  <a class=\"close\" data-dismiss=\"alert\">×</a> 
	  <div class = \"alert alert-success\"> 
	    Gracias, $name, atenderemos tu consulta lo antes posible. 
	  </div>"; 
	$subject = "Contacto Moodvie $asunto"; 
	$message = " Fecha: $todayis \n 
				 Asunto: $asunto \n 
				 Nombre: $name \n  
				 Email: $email \n 
				 "; 
	$from = "From: $email\r\n"; 
	mail("davidcarboneras@gmail.com", $subject, $message, $from); 
	echo($success) */
?> 
    </div> <!-- /container -->
	<div class="modal-footer">
		<p>&copy; MoodvieWeb</p>
	</div>
	
<?php require_once 'bootstrapjs.php';?>
<script type="text/javascript">
$(document).ready(
		function(){
		$('#contact-form').validate
		({
			rules: {
				name: {
					minlength: 2,
					required: true
				},
				email: {
				  required: false,
				  email: true
				},
				subject: {
				  minlength: 2,
				  required: true
				},
				message: {
				  minlength: 2,
				  required: true
				}
			},
			messages:
			{
				name:{
					required:"Introduzca su nombre",
					minlength:"Introduzca al menos 2 caracteres"
				},
				email:
				{
					email:"Introduzca un email válido"
				},
				subject:
				{
					required:"Indique un asunto",
					minlength:"Introduzaca al menos 2 caracteres"
				},
				message:
				{
					required:"Introduzca un mensaje",
					minlength:"Introduzaca al menos 2 caracteres"
				},
			},
			highlight:
			function(element, errorClass, validClass)
			{
				$(element).parents('.control-group').removeClass('success');
				$(element).parents('.control-group').addClass('error');
			},

			unhighlight: 
			function(element, errorClass, validClass)
			{
				$(element).parents('.control-group').removeClass('error');
				$(element).parents('.control-group').addClass('success');
			}
		});
	});
	</script>
</body>
</html>
